// TelegramData.java
package com.wangfugui.mybatisplus.cls;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = false)
@TableName("cls_telegram")
public class TelegramData {

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField("publish_time")
    private LocalDateTime publishTime;

    @TableField("title")
    private String title;

    @TableField("content")
    private String content;

    @TableField("url")
    private String url;

    @TableField("mobile_url")
    private String mobileUrl;

    @TableField("reading_num")
    private Integer readingNum;

    @TableField("id_original")
    private Long idOriginal;

    @TableField("audio_url")
    private String audioUrl;

    @TableField("create_time")
    private LocalDateTime createTime;

    @TableField("update_time")
    private LocalDateTime updateTime;

    public static void main(String[] args) {
        BigDecimal deduceAmount = new BigDecimal("99.98").divide(new BigDecimal("2"), 2, RoundingMode.HALF_UP);
        BigDecimal deduceAmount1 = new BigDecimal("99.98").multiply(new BigDecimal("0.5")).setScale(2, RoundingMode.HALF_UP);
        System.out.println(deduceAmount);
        System.out.println(deduceAmount1);
        System.out.println(deduceAmount.compareTo(deduceAmount1));
    }
}
